package com.cq.ssm.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.cq.ssm.mapper.JobMapper;
import com.cq.ssm.po.Job;
import com.cq.ssm.service.JobService;

@Component("jobService")
public class JobServiceImpl implements JobService {

	@Autowired
	private JobMapper jm;
	// 插入一条记录
	public boolean insertJob(Job job) throws Exception {
		int i = jm.insertSelective(job);
		return i==1?true:false;
	}

	// 根据id删除一条记录
	public boolean deleteById(Integer id) throws Exception {
		int i = jm.deleteByPrimaryKey(id);
		return i==1?true:false;
	}

	// 查询所有记录
	public List<Job> findAll() throws Exception {
		return jm.selectAllJob(null);
	}
}
